<div class="main-container">
    <!-- <div class="content-top-bar">
      <nz-radio-group
        [nzButtonStyle]="'solid'"
        [(ngModel)]="listType"
        (ngModelChange)="getListData()"
        style="margin-left: 15px"
      >
        <label nz-radio-button nzValue="0">上报数据</label>
        <label nz-radio-button nzValue="1">指标查看</label>
        <label nz-radio-button nzValue="2" *ngIf="isDivBtnShow">指标分解</label>
      </nz-radio-group>
    </div> -->
  
    <div class="main-content">
      <div class="content-top-bar">
        <div class="search-box">
          <nz-form-item class="fileItem">
            <nz-form-label>年份</nz-form-label>
            <nz-form-control>
              <nz-year-picker
                [(ngModel)]="year"
                (ngModelChange)="getMonthDetailData()"
              >
              </nz-year-picker>
            </nz-form-control>
          </nz-form-item>
          <nz-form-item class="fileItem">
            <nz-form-label>月份</nz-form-label>
            <nz-form-control>
              <nz-select
                nzAllowClear
                [(ngModel)]="monthSelection"
                (ngModelChange)="getMonthDetailData()"
              >
                <nz-option
                  *ngFor="let item of monthOptions"
                  [nzLabel]="item.label"
                  [nzValue]="item.value"
                ></nz-option>
              </nz-select>
            </nz-form-control>
          </nz-form-item>
          <nz-form-item class="fileItem" *ngIf="currentManageId == '10001'">
            <nz-form-label>管理处</nz-form-label>
            <nz-form-control>
              <nz-select
                nzAllowClear
                [(ngModel)]="manageId"
                (ngModelChange)="getMonthDetailData()"
              >
                <nz-option
                  *ngFor="let item of mngOption"
                  [nzLabel]="item.label"
                  [nzValue]="item.value"
                ></nz-option>
              </nz-select>
            </nz-form-control>
          </nz-form-item>
          <button nz-button nzType="default" (click)="reset()">重置</button>
        </div>
        <!-- <div class="table-btn-group" *ngIf="listType=='0' && manageId != '10001'"> -->
        <div class="table-btn-group"  *ngIf="manageId!=='1' || manageId===null">
          <!-- <button
            *ngIf="listType == '0' && manageId != '10001'"
            nz-button
            nzType="primary"
            (click)="onEdit('add', null, 1)"
          >
            计划填报原始
          </button> -->
          <button
            nz-button
            nzType="primary"
            style="margin-right: 20px"
            (click)="addPlan()"
          >
          计划填报
          </button>
        </div>
      </div>
  
      <div class="table-content dark-blue-table">
        <nz-table
          #monthPlan
          nzSize="middle"
          nzBordered
          [nzFrontPagination]="false"
  
          [nzData]="monthPlanDataFilter"
          [nzHideOnSinglePage]="true"
          [nzTotal]="total"
          [(nzPageIndex)]="pageNum"
          [(nzPageSize)]="pageSize"
  
          (nzPageIndexChange)="getGridData($event)"
        >
          <thead>
            <tr>
              <th style="width: 75px">序号</th>
              <th>计划名称</th>
              <th>时间</th>
              <!-- <th>状态</th> -->
              <th>操作</th>
            </tr>
          </thead>
          <tbody>
            <tr *ngFor="let row of monthPlan.data; let idx = index">
              <td>{{ idx + 1 }}</td>
              <td>{{ row.name }}</td>
              <td>{{ row.cycleName }}</td>
              <!-- <td *ngIf="listType != '2'">{{ row.stateName }}</td>
              <td *ngIf="listType === '2'">{{ row.divStateName }}</td> -->
              <td class="table-btn">
                <!-- 上报数据 -->
                <a *ngIf="listType === '0'" (click)="onEdit('view', row, 1)"
                  >查看</a
                >
                <a
                  *ngIf="manageId!=='1' || manageId===null"
                  (click)="onEdit('edit', row, 1)"
                  [ngStyle]="{ 'point-events': 'none' }"
                  >修改</a
                >
                <!-- 指标查看  数据分解-->
                <!-- <a
                  *ngIf="listType === '1' || listType === '2'"
                  (click)="onEdit('view', row)"
                  >查看2</a
                > -->
                <!-- 数据分解 -->
                <!-- <a
                  *ngIf="listType === '2' && row.divState == '1'"
                  (click)="onEdit('division', row)"
                  [ngStyle]="{ 'point-events': 'none' }"
                  >分解</a
                >
  
                <a
                  *ngIf="listType === '2' && row.divState == '1'"
                  (click)="exportMonthFile(row, '2')"
                  >导出3</a
                >
                <a *ngIf="listType != '2'" (click)="exportMonthFile(row, '1')"
                  >导出3</a -->
                
              </td>
            </tr>
          </tbody>
        </nz-table>
      </div>
    </div>
    <nz-modal
      [(nzVisible)]="isVisible"
      nzTitle="新增月旬计划"
      (nzOnCancel)="handleCancel()"
      (nzOnOk)="handleOk()"
    >
      <form nz-form >
     
        <nz-form-item>
          <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>年份</nz-form-label>
          <nz-form-control [nzSm]="14" [nzXs]="24">
            <nz-select
              name="select-error"
              [(ngModel)]="planYear"
              [ngModelOptions]="{ standalone: true }"
              (ngModelChange)="changeYear($event)"
  
            >
              <nz-option nzValue="2016" nzLabel="2016"></nz-option>
              <nz-option nzValue="2017" nzLabel="2017"></nz-option>
              <nz-option nzValue="2018" nzLabel="2018"></nz-option>
              <nz-option nzValue="2019" nzLabel="2019"></nz-option>
              <nz-option nzValue="2020" nzLabel="2020"></nz-option>
              <nz-option nzValue="2021" nzLabel="2021"></nz-option>
              <nz-option nzValue="2022" nzLabel="2022"></nz-option>
              <nz-option nzValue="2023" nzLabel="2023"></nz-option>
              <nz-option nzValue="2024" nzLabel="2024"></nz-option>
            </nz-select>
          </nz-form-control>
        </nz-form-item>
        <nz-form-item>
          <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>月份</nz-form-label>
          <nz-form-control [nzSpan]="12" [nzSm]="14" [nzXs]="24">
            <nz-select
              name="select-error"
              [(ngModel)]="planMouth"
              (ngModelChange)="changeMouth($event)"
              [ngModelOptions]="{ standalone: true }"
            >
              <nz-option nzValue="1" nzLabel="1月"></nz-option>
              <nz-option nzValue="2" nzLabel="2月"></nz-option>
              <nz-option nzValue="3" nzLabel="3月"></nz-option>
              <nz-option nzValue="4" nzLabel="4月"></nz-option>
              <nz-option nzValue="5" nzLabel="5月"></nz-option>
              <nz-option nzValue="6" nzLabel="6月"></nz-option>
              <nz-option nzValue="7" nzLabel="7月"></nz-option>
              <nz-option nzValue="8" nzLabel="8月"></nz-option>
              <nz-option nzValue="9" nzLabel="9月"></nz-option>
              <nz-option nzValue="d" nzLabel="冬灌"></nz-option>
  
            </nz-select>
          </nz-form-control>
        </nz-form-item>
        <nz-form-item *ngIf="planMouthShow">
          <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>旬选择</nz-form-label>
          <nz-form-control [nzSpan]="12" [nzSm]="14" [nzXs]="24">
            <nz-select
              name="select-error"
              [(ngModel)]="planMouthType"
              [ngModelOptions]="{ standalone: true }"
              (ngModelChange)="changeMouthType($event)"
  
            >
              <nz-option nzValue="F" nzLabel="上旬"></nz-option>
              <nz-option nzValue="S" nzLabel="中旬"></nz-option>
              <nz-option nzValue="T" nzLabel="下旬"></nz-option>
            </nz-select>
          </nz-form-control>
        </nz-form-item>
      </form>
    </nz-modal>
  </div>
  